/**
 *
 * @author Erivaldo Lourenco
 * @author Juliana Cavalcanti
 * 
 */

package br.ufal.ic.p3.Interface;

import java.awt.BorderLayout;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Color;

public class TelaErroCadastro extends JDialog {

	private final JPanel painelConteudo = new JPanel();
	private JButton botaoOK;
	private JLabel labelErroAoCadastrar;

	public TelaErroCadastro() {
		setBounds(100, 100, 440, 210);
		getContentPane().setLayout(new BorderLayout());
		painelConteudo.setBackground(Color.WHITE);
		painelConteudo.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(painelConteudo, BorderLayout.CENTER);
		{
			labelErroAoCadastrar = new JLabel("ERRO AO CADASTRAR");
		}
		GroupLayout gl_painelConteudo = new GroupLayout(painelConteudo);
		gl_painelConteudo.setHorizontalGroup(
			gl_painelConteudo.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_painelConteudo.createSequentialGroup()
					.addGap(136)
					.addComponent(labelErroAoCadastrar)
					.addContainerGap(147, Short.MAX_VALUE))
		);
		gl_painelConteudo.setVerticalGroup(
			gl_painelConteudo.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_painelConteudo.createSequentialGroup()
					.addGap(48)
					.addComponent(labelErroAoCadastrar)
					.addContainerGap(55, Short.MAX_VALUE))
		);
		painelConteudo.setLayout(gl_painelConteudo);
		{
			JPanel painelBotao = new JPanel();
			getContentPane().add(painelBotao, BorderLayout.SOUTH);
			{
				botaoOK = new JButton("OK");
				botaoOK.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						setVisible(false);
					}
				});
				botaoOK.setActionCommand("OK");
				getRootPane().setDefaultButton(botaoOK);
			}
			GroupLayout gl_painelBotao = new GroupLayout(painelBotao);
			gl_painelBotao.setHorizontalGroup(
				gl_painelBotao.createParallelGroup(Alignment.TRAILING)
					.addGroup(Alignment.LEADING, gl_painelBotao.createSequentialGroup()
						.addGap(184)
						.addComponent(botaoOK)
						.addContainerGap(189, Short.MAX_VALUE))
			);
			gl_painelBotao.setVerticalGroup(
				gl_painelBotao.createParallelGroup(Alignment.LEADING)
					.addGroup(gl_painelBotao.createSequentialGroup()
						.addComponent(botaoOK)
						.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
			);
			painelBotao.setLayout(gl_painelBotao);
		}
	}

}
